package com.zz.ecommerce.status;

import com.zz.ecommerce.common.bean.TReceiptsC;
import com.zz.ecommerce.common.bean.TReceiptsI;
import com.zz.ecommerce.common.constants.TableConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by admin on 2016/1/29.
 */
@Service
public class TReceiptsService {

    private final Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private TReceiptsCDao receiptsCDao;

    @Autowired
    private TReceiptsIDao receiptsIDao;


    public void updateCustReceiptsStatus(String id,String handleFlag,String reDeclareAppId){
        TReceiptsC receiptsC = new TReceiptsC();
        receiptsC.setReDeclareAppId(reDeclareAppId);
        receiptsC.setId(id);
        receiptsC.setHandleFlag(handleFlag);

        receiptsCDao.update(TableConstants.T_RECEIPTS_C,receiptsC," WHERE ID = #{updateObj.id}");
    }


    public void updateInspReceiptsStatus(String id,String handleFlag,String reDeclareAppId){
        TReceiptsI receiptsI = new TReceiptsI();
        receiptsI.setReDeclareAppId(reDeclareAppId);
        receiptsI.setId(id);
        receiptsI.setHandleFlag(handleFlag);

        receiptsIDao.update(TableConstants.T_RECEIPTS_I,receiptsI," WHERE ID = #{updateObj.id}");
    }
}
